<!--<?php
if($rg_allowregister == 1){print <<<EOT
-->
<div class="p10">
	<h5 class="h5 mb10"><strong class="mr20">通过链接邀请</strong></h5>
	<div class="mb10">
		<div class="mb5">通过这个链接注册后，你们可以直接成为好友</div>
		<div class="mb20"><input type="text" class="input mr5" size="90" value="$spaceurl" id="copy_invite"><span class="btn2"><span><button type="button" onclick="copyUrl(getObj('copy_invite').value)">复制链接</button></span></span></div>
<!--
EOT;
	if ($inv_linkopen) {print <<<EOT
-->
		<div>
<!--
EOT;
		if ($inv_linktype) {print <<<EOT
-->
			<div class="mb5">通过这个链接注册后，你可以获得<span class="s2">{$inv_linkscore}个{$credit->cType[$inv_linkcredit]}</span>奖励</div>
<!--
EOT;
		} else {print <<<EOT
-->
			<div class="mb5">通过这个链接访问后，你可以获得<span class="s2">{$inv_linkscore}个{$credit->cType[$inv_linkcredit]}</span>奖励</div>
<!--
EOT;
		}
$inviteUsername = rawurlencode($windid);
print <<<EOT
-->
			<div class="mb10"><input type="text" value="$db_bbsurl/index.php?a=$inviteUsername" class="input mr5" size="90" id="copy_username"><span class="btn2"><span><button type="button" onclick="copyUrl(getObj('copy_username').value)">复制链接</button></span></span></div>
			<div><input type="text" value="$db_bbsurl/index.php?u=$winduid" class="input mr5" size="90" id="copy_uid"><span class="btn2"><span><button type="button" onclick="copyUrl(getObj('copy_uid').value)">复制链接</button></span></span></div>
		</div>
<!--
EOT;
	}print <<<EOT
-->
	</div>
</div>
<script type="text/javascript">
function copyUrl(url) {
	if (is_ie) {
		if(window.clipboardData.setData("Text",url)){
			showDialog('success','已成功复制',1);
		}
	} else {
		prompt('按下 Ctrl+C 复制到剪贴板', url)
	}
}
</script>
<!--
EOT;
if($ml_mailifopen){print <<<EOT
-->
<div class="p10">
<h5 class="h5"><strong class="mr20">通过电子邮箱邀请</strong>（网站不会记录您的任何账号、密码信息）</h5>
<div class="mb20">
<ul class="half mailadd cc">
<!--
EOT;
if(function_exists('curl_init')){print <<<EOT
-->
   	<li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=friendinvite&step=email');"><p>导入电子邮箱通讯录至邀请名单</p>支持<b class="s4">126、163、Gmail</b>等3种邮箱</a></li>
    <li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=friendinvite&step=msn');"><p>导入MSN联系人至邀请名单</p>导入<b class="s4">MSN</b>账户中的联系人名单</a></li>
<!--
EOT;
}print <<<EOT
-->
    <li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=friendinvite&step=simple');"><p>直接发送邀请邮件</p>直接向对方的电子邮箱发送邀请邮件</a></li>
    <li><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=friendinvite&step=csv');"><p>导入电子邮箱客户端联系人备份文件</p>支持<b class="s4">csv</b>备份文件导入</a></li>
</ul>
</div>
</div>
<!--
EOT;
}if(!$ml_mailifopen && !$inv_linkopen){
print <<<EOT
-->
<div class="p15 tac f14">您还没有开启宣传链接或者电子邮箱功能</div>
<!--
EOT;
}}elseif ($rg_allowregister == 2) {print <<<EOT
-->
<script type="text/javascript">
function inviteCode(form,type){
	var content = '';
	var str = type == 'copy' ? "\\n" : ',';
    var url = type == 'copy' ? '$db_bbsurl/$db_registerfile?invcode=' : '';
	for (var i = 0; i < form.elements.length; i++) {
		var e = form.elements[i];
		if (e.type == 'checkbox' && e.checked == true && e.value != 'all') {
			content += url + e.value + str;
		}
	}
	if(content == ''){
		showDialog('error','请选择要发送的邀请码',0);
		return false;
	}
	if(type == 'copy'){
		if (is_ie) {
			if(window.clipboardData.setData("Text",content)){
				showDialog('success','已成功复制',1);
			}
		} else {
			prompt('按下 Ctrl+C 复制到剪贴板', content)
		}
	}else{
	     sendmsg('pw_ajax.php?action=friendinvite&step=simple&invcode='+content);
	}
}
</script>
<div class="c mb10">&nbsp;</div>
<!--
EOT;
if(empty($invdb)){
print <<<EOT
-->
<div class="p15 tac f14">没有可用的邀请码，请到<a href="u.php?a=friend&type=inviteCode">邀请码管理</a>中购买</div>
<!--
EOT;
}else{
print <<<EOT
-->
<div class="p10">
<h5 class="h5 mb10"><strong class="mr20">邀请码</strong></h5>
<form method="post" action="" name="INVLINKS">
<table width="100%" class="tA mb10">
    <tr class="tr">
     	<td>
     		<label><input name="" type="checkbox" value="all" onclick="CheckAll(this.form)"> 全选</label>
		</td>
        <td>可用邀请链接</td>
        <td>有效期</td>
    </tr>
<!--
EOT;
foreach($invdb as $key => $value){
$invlink = $db_bbsurl.'/'.$db_registerfile.'?invcode=' . $value['invcode'];
print <<<EOT
-->
    <tr>
    	<td><input name="invlink" type="checkbox" value="{$value[invcode]}"></td>
        <td><input type="text" value="{$invlink}" class="input" size="80" readonly="readonly"/></td>
        <td><p>{$value[overtime]}</p></td>
    </tr>
<!--
EOT;
}print <<<EOT
-->
    <tr class="tr">
    	<td><label><input name="" type="checkbox" value="all" onclick="CheckAll(this.form)"> 全选</label></td>
      <td><span class="bt2"><span><button type="button" onclick="inviteCode(document.INVLINKS,'copy')">复制邀请链接到剪切板</button></span></span><span class="btn2"><span><button type="button" onclick="inviteCode(document.INVLINKS)">通过电子邮箱发送邀请链接</button></span></span></td>
      <td>&nbsp;</td>
    </tr>
</table>	
<div class="cc">{$pages}</div>
</form>
</div>
<!--
EOT;
}}?>-->